<?php

class Page
{
    private $_item;
    private $_id;
    private $_description;

    public function __construct( $id )
    {
        $this->_id = $id;
        $this->_item = get_post($id, OBJECT);
    }

    public function Dump()
    {
        var_dump($this->_item);
    }

    public function Categories()
    {
        return get_the_category($this->_id);
    }

    public function Title()
    {
        return $this->_item->post_title;
    }

    public function AuthorID()
    {
        return $this->_item->post_title;
    }

    public function PublicationDateTime()
    {
        return $this->_item->post_date;
    }

    public function ModificationDateTime()
    {
        return $this->_item->post_modified;
    }

    public function ParentID()
    {
        return $this->_item->post_parent;
    }

    public function Excerpt()
    {
        return $this->_item->post_excerpt;
    }

    public function Status()
    {
        return $this->_item->post_status;
    }

    public function Description()
    {
        if(empty($this->_description))
        {
            $this->_description = get_post_meta( $this->_id, 'description' );
            if(empty($this->_description)) {
                $this->_description = "";
            }
        }
        return $this->_description ;
    }
}
?>
